//用户信息

// import {LoginOut} from "@/request/api/user";
// import {StorageToken, StorageUserInfo} from "@/utils/storageUser";

export default {
    namespaced: true,
    state: {
        wxInfo: null,
        userInfo: null
    },
    mutations: {
        SET_WXINFO(state, obj) {
            state.wxInfo = obj
        },
        SET_USERINFO(state, obj) {
            console.log(obj)
            state.userInfo = obj
        },
        REMOVE_USERINFO(state) {
            state.userInfo = null
        },
    },
    actions: {
        set_wxInfo({commit}, obj) {
            commit('SET_WXINFO', obj)
        },
        set_userInfo({commit}, data) {
            commit('SET_USERINFO', data)
        },
        // login_out({commit}) {
        //     return new Promise((resolve => {
        //         LoginOut().then(res => {
        //             if (res.success) {
        //                 //不能清除平台flag，否则无法发起http请求
        //                 commit('REMOVE_USERINFO')
        //                 resolve()
        //             }
        //         })
        //     }))
        // }
    },
}